class Fee extends Fo {
    public void method1() {
        System.out.println("Fee 1");
        super.method3();
    }

    public void method3() {
        System.out.println("Fee 3");
    }
}

class Fie extends Fum {
    public void method1() {
        System.out.println("Fie 1");
    }

    public void method3() {
        System.out.println("Fie 3");
        super.method3();
    }
}

class Fo {
    public void method2() {
        System.out.println("Fo 2");
        method3();
    }

    public void method3() {
        System.out.println("Fo 3");
    }
}

class Fum extends Fo {
    public void method3() {
        System.out.println("Fum 3");
    }
}

public class Inheritance4 {
    public static void main(String[] args) {
        Fum var1 = new Fie();
        Object var2 = new Fum();
        Fo var3 = new Fee();
        Object var4 = new Fie();
        Object var5 = new Fo();
        Fum var6 = new Fum();
        
        var1.method2();
        System.out.println();
        //var2.method2();
        var3.method2();
        System.out.println();
        //var4.method2();
        //var5.method2();
        var6.method2();
        System.out.println();
        var1.method3();
        System.out.println();
        //var2.method3();
        var3.method3();
        System.out.println();
        //var4.method3();
        //var5.method3();
        var6.method3();
        System.out.println();
        ((Fee)var3).method1();
        System.out.println();
        //((Fee)var4).method1();
        ((Fie)var1).method2();
        System.out.println();
        ((Fo)var3).method3();
        System.out.println();
        //((Fie)var6).method2();
        ((Fo)var2).method3();
        System.out.println();
        //((Fie)var3).method1();
        ((Fo)var5).method2();
        System.out.println();
    }
}
